#ifndef							__PROCESSOR_H__
#define							__PROCESSOR_H__

#include						<QObject>
#include						<QDesktopServices>
#include						<QUrl>
#include						"api.h"
#include						"packet.h"
#include						"packetmanager.h"
#include						"audio.h"
#include						"packetbuffer.h"

class							PacketHandler;

class							Processor : public QObject
{
	Q_OBJECT

public:
	Processor(QObject *parent = 0);
	~Processor();

private:
	Api							*_api;
	PacketManager				*_pkgManager;
	PacketBuffer				_pkgBuff;

private:
	void						initConnect();

public:
	void						setApi(Api*);
	PacketHandler				*getPacketHandler();
	void						interpret(Packet*);

public slots:
	void						handleConnect(const connectInfo info);
	void						handleConnected(QHostAddress &);
	void						handleDisconnected(QHostAddress &);
	void						handleMode(quint16, bool);
	void						handleConfig(quint16 id);
	void						handleNewPacket(Packet&);
	void						handleNewSound(SoundPacket *);
	void						handleRecordMod(bool);
};

#endif // PROCESSOR_H
